home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / x / volume14 / olvwm / patch2.02 < prev    next >
Encoding:
Text File  |  1992-08-30  |  33.5 KB  |  1,030 lines

  1. Newsgroups: comp.sources.x
  2. Subject: v14i008: olvwm - Open Look Virtual Window Manager, Patch2, Part02/03
  3. Date: 27 Aug 91 06:00:04 GMT
  4. References: <csx-14i007-olvwm@uunet.UU.NET>
  5. Patch-To: olvwm:  Volume 12, Issues 57-72
  6. Patch-To: olvwm:  Volume 14, Issues 6
  7. Submitted-by: sdo@soliado.East.Sun.COM (Scott Oaks - Sun Consulting NYC)
  8.  
  9. *** build/olvwm.man    Sat Jun 22 20:09:01 1991
  10. --- src/olvwm.man    Sat Jun 22 20:56:21 1991
  11. ***************
  12. *** 1,5 ****
  13. ! .\" @(#)olvwm.1    1.3 olvwm version 4/17/91
  14. ! .TH OLVWM 1 "31 March 1991"
  15.   .SH NAME
  16.   olvwm \- OPEN LOOK virtual window manager for OpenWindows
  17.   .SH SYNOPSIS
  18. --- 1,5 ----
  19. ! .\" @(#)olvwm.man    1.4 olvwm version 6/22/91
  20. ! .TH OLVWM 1 "17 June 1991"
  21.   .SH NAME
  22.   olvwm \- OPEN LOOK virtual window manager for OpenWindows
  23.   .SH SYNOPSIS
  24. ***************
  25. *** 80,115 ****
  26.   .LP
  27.   This window manager also includes David Plotkin's auto-pinned root menu
  28.   resources.
  29. ! .SH MOVING WINDOWS
  30.   .LP
  31. ! You move windows on the screen just as you normally would in
  32. ! .B olwm.
  33. ! You can also drag windows from the screen into the virtual desktop manager
  34. ! or from the virtual desktop manager to the screen, or just within the
  35. ! virtual desktop manager.  Note that if you select on a window's frame
  36. ! which is overlapping the virtual desktop manager you will end up dragging
  37. ! the window into the virtual desktop manager.  You can set the
  38. ! AllowMoveIntoDesktop resource to false if you are bothered by this
  39. ! behaviour.
  40. ! .SH MANIPULATING THE VIRTUAL DESKTOP
  41.   .LP
  42. ! If you select a window inside the virtual desktop manager, you can move
  43. ! the window.  If, however, you select the background area of the virtual
  44. ! desktop manager within the viewing rectangle, you can move the viewing
  45. ! rectangle of the desktop.  When you release the mouse button, the
  46. ! desktop will shift and you will now see the windows within the
  47. ! virtual desktop manager's viewing rectangle.
  48.   .LP
  49. ! You can also use the arrow keys to move the viewing rectangle and affect
  50. ! your view.  If the virtual desktop manager has the keyboard focus,
  51. ! simply press the right arrow to move your view into the desktop to
  52. ! the right, etc.  If your set the allowArrowInRoot resource to true (which,
  53. ! in fact, is it's default value), then arrows keys will work when the
  54. ! root window has the keyboard focus as well.
  55.   .LP
  56. ! You can use the arrow keys when the virtual desktop manager has been
  57. ! iconified (though you must keep track mentally of where on the desktop
  58. ! you are).
  59.   .SH RESIZING THE VIRTUAL DESKTOP
  60.   .LP
  61.   You can use the resize corners on the virtual desktop manager to resize
  62. --- 80,188 ----
  63.   .LP
  64.   This window manager also includes David Plotkin's auto-pinned root menu
  65.   resources.
  66. ! .SH EVENTS IN THE VDM
  67.   .LP
  68. ! The processing of events within the VDM depends on whether the mouse is
  69. ! pointing to the background area of the VDM or to a particular virtual window
  70. ! within the VDM.
  71. ! .SH EVENTS ON VIRTUAL WINDOWS
  72.   .LP
  73. ! Events which occur in a particular virtual window behave just as if they
  74. ! were delivered to the real application's frame.  Thus, pressing the MENU
  75. ! button over a virtual window will bring up the frame menu and allow the 
  76. ! real (and virtual) windows to be opened, closed, fullsized, etc.  Pressing
  77. ! the SELECT button will select that real (and virtual) window; pressing the
  78. ! ADJUST button will add (or subtract) that window from the selection list.
  79. ! Pressing the FRONT or OPEN keys will raise/lower or open/close the real
  80. ! (and virtual) window.
  81.   .LP
  82. ! SELECTing and dragging one or more virtual windows will move the real and
  83. ! virtual windows (just as in 
  84. ! .B olwm
  85. ! ).  Note that if you drag the mouse outside of the VDM, the window can be
  86. ! moved within to the current (visible) desktop.  Conversely, when dragging
  87. ! a window on the screen, if the mouse moves into the VDM, the window will then
  88. ! be moved to the location on the displayed within the VDM.  Some users find
  89. ! this behaviour annoying; it can be turned off by setting the
  90. ! AllowMoveIntoDesktop resource to False.  Note that if a frame is obscuring
  91. ! the VDM and you select/drag on that frame, it will be dragged into the VDM
  92. ! immediately.
  93.   .LP
  94. ! Note that events are delivered ONLY to the real application's frame.  Thus,
  95. ! typing characters or the COPY/CUT/PASTE keys has no effect.
  96. ! .SH EVENTS ON THE VDM BACKGROUND
  97. ! .LP
  98. ! Events on the VDM background all work to move the visible desktop, bringing
  99. ! windows which were formerly outside of the viewing area onto the screen (and
  100. ! moving windows which were on the screen outside of the viewing area).
  101. ! Keyboard events are described given the default Sun-4 keyboard mappings,
  102. ! but you can use xmodmap to set up your particular keyboard.
  103. ! .LP
  104. ! The actions associated with Keyboard Events in the VDM Background also occur
  105. ! for Keyboard events when the root window has the keyboard focus.  In addition,
  106. ! if the META key is held down (the diamond key on Sun keyboards), then
  107. ! the action will occur regardless of where the keyboard focus is located.
  108. ! .LP
  109. ! Note:  if you must remap
  110. ! a non-Sun keyboard, the arrow events are XK_Left, XK_Right, XK_Up, and
  111. ! XK_Down; the diagonal events are XK_R7 [up/left], XK_R9 [up/right], XK_R13
  112. ! [down/left], XK_R15 [down/right], and XK_R11 [upper-left corner]. The function
  113. ! keys are XK_F1 to XK_F10.  The
  114. ! META key is the ModMap1 key.
  115. ! .LP
  116. ! 1)  ARROW KEYS AND NUMERIC KEYPAD KEYS
  117. ! .LP
  118. ! The arrow keys move the visible region in the specified direction.  In
  119. ! addition, the R keys on the numeric keypad around the arrow keys move the
  120. ! visible region diagonally according to their position.  This is intuitive
  121. ! from a graphical viewpoint, though the key labels are awkward:  Home moves
  122. ! the visible area up and right; PgUp moves it up and left; etc.  Finally, the
  123. ! key in the middle of this pad (the R11 or 5 key) moves the visible region
  124. ! to the uppermost-leftmost position in the VDM.
  125. ! .LP
  126. ! Key movement occurs in screen-sized increments.  If the SHIFT key is held
  127. ! down while the motion key is pressed, movement will be in 2-screen increments.
  128. ! If the CTRL key is held down, movement will be in 1/2-screen increments.
  129. ! If both are held down, movement will be in 20-screen increments, which is
  130. ! effectively to the appropriate edge of the VDM.  Note that if the visible
  131. ! region is not aligned on a logical screen boundary, using the arrow keys
  132. ! will not position it on such a boundary.
  133. ! .LP
  134. ! 2)  FUNCTION KEYS
  135. ! .LP
  136. ! The Function Keys F1 to F10 move the visible region to a logical screen
  137. ! numbered 1 to 10.  Logical screen are numbered from the upper-left corner
  138. ! by column and then by row.  The CTRL key adds 10 to the logical screen
  139. ! number (i.e. screen 11 can be reached with CTRL-F1).  The SHIFT key adds
  140. ! 20 to the logical screen number.  Both together adds 30 to the logical
  141. ! screen number.  [If you're running on a 4/490 and have 41 screens full of
  142. ! windows, you're out of luck.]
  143. ! .LP
  144. ! On Sun Keyboards without a Help Key, the F1 key is normally mapped to the
  145. ! Help key.  To support both Sun-3 and Sun-4 keyboards, the default .xinitrc
  146. ! file provided by Sun's OpenWindows product maps this key regardless of 
  147. ! the type of keyboard you have.  The upshot of this is that if you want 
  148. ! the F1 key to move windows within olvwm, you must take out the line in
  149. ! your .xinitrc file which calls xmodmap for F1.  Alternately, you can get
  150. ! to logical screen number 1 with the R11 key.
  151. ! .LP
  152. ! 3) SELECT MOUSE EVENTS
  153. ! .LP
  154. ! SELECTing on the VDM background allows you to drag the visible region within
  155. ! the VDM.  If the VirtualGrid resource is set to Visible or Invisible, movement
  156. ! of the visible region will be constrained to logical screen boundaries
  157. ! unless the CTRL button is pressed before and held while dragging the mouse.
  158. ! If the VirtualGrid resource is set to None, movement of the visible region
  159. ! will be unconstrained unless the CTRL button is pressed before and held while
  160. ! dragging the mouse.
  161. ! .LP
  162. ! Double clicking on an area in the VDM background will move the visible region
  163. ! to the logical screen containing the point where the mouse was double-clicked.
  164. ! .LP
  165. ! 4)  MENU MOUSE EVENTS
  166. ! .LP
  167. ! The MENU button brings up a (pinnable) menu which will allow movement based
  168. ! on the arrow keys described above.
  169.   .SH RESIZING THE VIRTUAL DESKTOP
  170.   .LP
  171.   You can use the resize corners on the virtual desktop manager to resize
  172. ***************
  173. *** 129,153 ****
  174.   .LP
  175.   Windows which are "sticky" never move position on the screen when you
  176.   change your view into the desktop.  To set a particular window as
  177. ! sticky, simply select "Stick" in it's frame menu. You may similarly
  178. ! unstick the window via it's menu.
  179.   .LP
  180.   [Note:  Only
  181. ! base frames are eligible to become sticky; frames inherit the stickyness
  182.   of their base frames.  Thus, for a particular application, either
  183.   all windows are sticky or none of them are.  The exception to this is
  184.   that base frames created after a base frame is set to be "sticky" are created
  185. ! as unsticky.  For most OPEN LOOK applications, this affects only pin-up
  186. ! menus; you should pin any menus you want to be sticky BEFORE you set
  187. ! the base frame to be sticky.]
  188.   .LP
  189. ! Windows are sticky by default it their class name (set via the WM_CLASS)
  190. ! property is in the list of strings for VirtualSticky (see RESOURCES below)
  191.   .SH PLACING WINDOWS
  192.   .LP
  193. ! If you specify a window placement directly (via -Wp arguments or
  194. ! X11 geometry screens), the window will appear at that location on
  195. ! the virtual desktop (even if that location is not currently visible).
  196.   .LP
  197.   If you do not specify a window position, then
  198.   .B olvwm
  199. --- 202,237 ----
  200.   .LP
  201.   Windows which are "sticky" never move position on the screen when you
  202.   change your view into the desktop.  To set a particular window as
  203. ! sticky, simply select "Stick" in its frame menu. You may similarly
  204. ! unstick the window via its menu.
  205.   .LP
  206.   [Note:  Only
  207. ! base frames are eligible to become sticky; other frames inherit the stickyness
  208.   of their base frames.  Thus, for a particular application, either
  209.   all windows are sticky or none of them are.  The exception to this is
  210.   that base frames created after a base frame is set to be "sticky" are created
  211. ! as unsticky.]
  212.   .LP
  213. ! Windows are sticky by default if their class name (set via the WM_CLASS),
  214. ! their instance name (set via WM_INSTANCE), or their actual name (set via
  215. ! the WM_NAME)
  216. ! property is in the list of strings for VirtualSticky (see RESOURCES below).
  217. ! For tools which have a multi-word WM_NAME (e.g. Mailtool, which has a
  218. ! WM_NAME of Mail Tool - /var/spool/mail/user), use only the first word
  219. ! (e.g. Mail).
  220. ! .LP
  221. ! In OPENLOOK applications, you cannot set the WM_INSTANCE or WM_CLASS of a
  222. ! tool, but its
  223. ! name may be set with the -name command-line and, for some tools, interactively
  224. ! as well.  The WM_NAME is displayed in the window's header.
  225.   .SH PLACING WINDOWS
  226.   .LP
  227. ! The placing of windows is subject to the RelativePosition resource
  228. ! below. Basically, when this is true (its default)
  229. ! windows at startup can be placed anywhere, so absolute positions can be given
  230. ! in your .openwin-init (or .xinitrc) file.  Then, when starting windows
  231. ! interactively, they will be brought up on the current screen in a position
  232. ! based on the specified position modulus the screen size.
  233.   .LP
  234.   If you do not specify a window position, then
  235.   .B olvwm
  236. ***************
  237. *** 255,266 ****
  238.   .TP
  239.   .BI VirtualBackgroundMap " (Pixmap filename)"
  240.   The name of a file containing a pixmap to use as the background of the
  241. ! virtual desktop manager.  This item, if present, takes precedence over
  242. ! the VirtualBackgroundColor.
  243.   .I
  244.   Default value:  unused
  245.   .P
  246.   .TP
  247.   .BI AutoShowRootMenu " (Bool)"
  248.   If true, the root menu will come up pinned at start up.
  249.   .I
  250. --- 339,356 ----
  251.   .TP
  252.   .BI VirtualBackgroundMap " (Pixmap filename)"
  253.   The name of a file containing a pixmap to use as the background of the
  254. ! virtual desktop manager.  This will be drawn with the VirtualBackgroundColor
  255. ! as its background color and the VirtualPixmapColor as its foreground color.
  256.   .I
  257.   Default value:  unused
  258.   .P
  259.   .TP
  260. + .BI VirtualPixmapColor " (color specification)"
  261. + See above.
  262. + .I
  263. + Default value:  white
  264. + .P
  265. + .TP
  266.   .BI AutoShowRootMenu " (Bool)"
  267.   If true, the root menu will come up pinned at start up.
  268.   .I
  269. ***************
  270. *** 288,293 ****
  271. --- 378,423 ----
  272.   .I
  273.   Default value:  Null
  274.   .P
  275. + .TP
  276. + .BI RelativePosition " (boolean)"
  277. + If true, then user-specified window co-ordinates are assumed to be relative
  278. + to the current view into the desktop; otherwise they are absolute with
  279. + respect to the desktop.  Setting to true will not allow you to bring up
  280. + windows outside your current view, and setting to false will break some
  281. + programs which save window states in an odd manner.
  282. + .I
  283. + Default value:    True
  284. + .P
  285. + .TP
  286. + .BI GrabVirtualKeys " (boolean)"
  287. + If true, allows the META key to be used in conjunction with arrow/function
  288. + keys when moving windows:  the desktop will move no matter where keyboard
  289. + focus happens to be at the time.  This obviates the need to move the mouse
  290. + onto the root to use the arrow keys to move the desktop.  But this may
  291. + potentially conflict with some applications, in which case it must be set
  292. + to false.
  293. + .I
  294. + Default value:  True
  295. + .P
  296. + .TP
  297. + .BI VirtualGrid " (Visible, Invisible, or None)"
  298. + This controls two aspects of the VDM:  If it's visible or invisible, the
  299. + grid is on (but it's only drawn if it's visible).  If it's None, the grid
  300. + is off.
  301. + .TP
  302. + If the grid is on, the VDM may only be resized in logical screen-sized
  303. + increments.  Otherwise, it may resized to arbitrary sizes.  If the grid
  304. + is on, SELECT/dragging the mouse within the VDM will constrain the move to
  305. + logical screens (unless the CTRL button is held down); if the grid is off,
  306. + moving the visible screen region with SELECT/drag will be unconstrained
  307. + (unless the CTRL button is held down).
  308. + .I
  309. + Default value:    Visible
  310. + .TP
  311. + .BI VirtualGridColor " (color specification)"
  312. + If the VirtualGrid is Visible, it will be drawn in this color.
  313. + .I
  314. + Default value:  Same as VirtualFontColor
  315.   .\" ========================================================================
  316.   .SH COPYRIGHTS
  317.   .LP
  318. ***************
  319. *** 309,317 ****
  320.   .br
  321.   Portions may be (c) 1990 Solbourne Computers.
  322.   .br
  323.   Please see the LEGAL_NOTICES file for full disclosure of copyright
  324.   information.
  325.   .\" ========================================================================
  326.   .SH BUGS
  327.   .LP
  328. --- 439,463 ----
  329.   .br
  330.   Portions may be (c) 1990 Solbourne Computers.
  331.   .br
  332. + Portions not covered under the above copyrights are (c) 1991 Scott Oaks.
  333. + .br
  334.   Please see the LEGAL_NOTICES file for full disclosure of copyright
  335.   information.
  336. ! .SH CREDITS
  337. ! .\" =======================================================================
  338. ! .LP
  339. ! Most of the code in this application comes from release 2.0 of olwm,
  340. ! authored at Sun Microsystems and distributed in the contrib section
  341. ! of MIT's X11R4.
  342. ! .br
  343. ! The virtual desktop section was authored by Scott Oaks.
  344. ! who is responsible for its maintenance.  Please direct any comments to 
  345. ! scott.oaks@sun.com.  This code is not supported by Sun Microsystems in
  346. ! any way.
  347. ! .br
  348. ! Notwithstanding the above, the staff at Sun Microsystems, and especially
  349. ! Stuart Marks, deserves credit as original author of olwm for most of the
  350. ! work contained in this application.
  351.   .\" ========================================================================
  352.   .SH BUGS
  353.   .LP
  354. ***************
  355. *** 320,332 ****
  356.   resource RefreshRecursively to False in order to get refreshes on the
  357.   virtual desktop to work correctly.
  358.   .LP
  359. - New frames should inherit the stickyness of their parent.
  360. - .LP
  361.   The virtual desktop manager icon is, in the words of an office mate,
  362.   ``pretty lame.''  Better yet, though, it should show feedback so it's
  363. ! possible to tell when on the desktop you are when it's closed.
  364.   .LP
  365. ! Need a way for base windows to be sticky on creation (but I don't
  366. ! like tvtwm's method of having particular applications sticky).
  367. ! .LP
  368. ! Probably scores more; this was a weekend-type hack after all :-).
  369. --- 466,473 ----
  370.   resource RefreshRecursively to False in order to get refreshes on the
  371.   virtual desktop to work correctly.
  372.   .LP
  373.   The virtual desktop manager icon is, in the words of an office mate,
  374.   ``pretty lame.''  Better yet, though, it should show feedback so it's
  375. ! possible to tell where on the desktop you are when it's closed.
  376.   .LP
  377. ! Probably scores more; this was a spare-time hack after all :-).
  378. *** build/resources.c    Sat Jun 22 20:52:44 1991
  379. --- src/resources.c    Sat Jun 22 20:56:15 1991
  380. ***************
  381. *** 6,12 ****
  382.    *    Written for Sun Microsystems by Crucible, Santa Cruz, CA.
  383.    */
  384.   
  385. ! static char     sccsid[] = "@(#)resources.c    1.6 olvwm version 5/9/91";
  386.   
  387.   /*
  388.    * Based on
  389. --- 6,12 ----
  390.    *    Written for Sun Microsystems by Crucible, Santa Cruz, CA.
  391.    */
  392.   
  393. ! static char     sccsid[] = "@(#)resources.c    1.7 olvwm version 6/22/91";
  394.   
  395.   /*
  396.    * Based on
  397. ***************
  398. *** 72,77 ****
  399. --- 72,79 ----
  400.   static Bool setBeepResource();
  401.   extern Bool updIconLocation();
  402.   extern Bool updBorderColor();
  403. + extern Bool UpdVirtualGrid();
  404. + extern Bool SetGridResource();
  405.   
  406.   Bool UpdInputFocusStyle();
  407.   
  408. ***************
  409. *** 219,225 ****
  410.           &(GRV.VirtualBackgroundColor),    VirtualSetColor,    UpdVirtualBgColor },
  411.       { ".virtualBackgroundMap",    ".VirtualBackgroundMap", NULL,
  412.           &(GRV.VirtualBackgroundMap),        setCharResource,    UpdVirtualMap },
  413. !     { ".virtualIconGeometry",    ".VirtualIconGeometry",    "0x0",
  414.           GRV.VirtualIconGeometry,    setStringResource,    UpdVirtualIconGeometry},
  415.       { ".virtualForegroundColor",    ".VirtualForegroundColor",    "-1",
  416.           &(GRV.VirtualForegroundColor),    VirtualSetColor,    UpdVirtualFgColor },
  417. --- 221,227 ----
  418.           &(GRV.VirtualBackgroundColor),    VirtualSetColor,    UpdVirtualBgColor },
  419.       { ".virtualBackgroundMap",    ".VirtualBackgroundMap", NULL,
  420.           &(GRV.VirtualBackgroundMap),        setCharResource,    UpdVirtualMap },
  421. !     { ".virtualIconGeometry",    ".VirtualIconGeometry",    "",
  422.           GRV.VirtualIconGeometry,    setStringResource,    UpdVirtualIconGeometry},
  423.       { ".virtualForegroundColor",    ".VirtualForegroundColor",    "-1",
  424.           &(GRV.VirtualForegroundColor),    VirtualSetColor,    UpdVirtualFgColor },
  425. ***************
  426. *** 235,245 ****
  427.           &(GRV.VirtualIconic),    setBoolResource,    (BFuncPtr) 0 },
  428.       { ".virtualSticky",        ".VirtualSticky",    "",
  429.           &(GRV.StickyList),        setMinimalDecor,    (BFuncPtr)0 },
  430.   };
  431.   
  432.   /* private data */
  433.   
  434. ! static Bool matchString();
  435.   static Bool matchBool();
  436.   static Bool matchFocusType();
  437.   static Bool matchIconPlace();
  438. --- 237,257 ----
  439.           &(GRV.VirtualIconic),    setBoolResource,    (BFuncPtr) 0 },
  440.       { ".virtualSticky",        ".VirtualSticky",    "",
  441.           &(GRV.StickyList),        setMinimalDecor,    (BFuncPtr)0 },
  442. +     { ".relativePosition",        ".RelativePosition",    "True",
  443. +         &(GRV.RelativePosition),    setBoolResource,    (BFuncPtr)0 },
  444. +     { ".grabVirtualKeys",        ".GrabVirtualKeys",    "True",
  445. +         &(GRV.GrabVirtualKeys),    setBoolResource,    (BFuncPtr)0 },
  446. +     { ".virtualPixmapColor",    ".VirtualPixmapColor",    NULL,
  447. +         &(GRV.VirtualPixmapColor),    VirtualSetColor,    UpdVirtualMap },
  448. +     { ".virtualGrid",        ".VirtualGrid",        "Visible",
  449. +         &(GRV.VirtualGrid),        SetGridResource,    UpdVirtualGrid },
  450. +     { ".virtualGridColor",        ".VirtualGridColor",    "Black",
  451. +         &(GRV.VirtualGridColor),    VirtualSetColor,    UpdVirtualGrid },
  452.   };
  453.   
  454.   /* private data */
  455.   
  456. ! Bool matchString();
  457.   static Bool matchBool();
  458.   static Bool matchFocusType();
  459.   static Bool matchIconPlace();
  460. ***************
  461. *** 256,262 ****
  462.    * Determine whether value matches pattern, irrespective of case.
  463.    * This routine is necessary because not all systems have strcasecmp().
  464.    */
  465. ! static Bool
  466.   matchString( value, pattern )
  467.   char *value;
  468.   char *pattern;
  469. --- 268,274 ----
  470.    * Determine whether value matches pattern, irrespective of case.
  471.    * This routine is necessary because not all systems have strcasecmp().
  472.    */
  473. ! Bool
  474.   matchString( value, pattern )
  475.   char *value;
  476.   char *pattern;
  477. ***************
  478. *** 918,924 ****
  479.           NewS = newValue;
  480.           if ( varSet )
  481.           {
  482. !             if ( NewS == RMTable[rmIndex].varAddr )
  483.                   return( updateNeeded );
  484.               else
  485.                   updateNeeded = True;
  486. --- 930,937 ----
  487.           NewS = newValue;
  488.           if ( varSet )
  489.           {
  490. !             /*if ( NewS == RMTable[rmIndex].varAddr )*/
  491. !             if (!strcmp(NewS, RMTable[rmIndex].varAddr))
  492.                   return( updateNeeded );
  493.               else
  494.                   updateNeeded = True;
  495. *** build/resources.h    Sat Jun 22 20:08:49 1991
  496. --- src/resources.h    Sat Jun 22 20:56:16 1991
  497. ***************
  498. *** 6,12 ****
  499.    *    Written for Sun Microsystems by Crucible, Santa Cruz, CA.
  500.    */
  501.   
  502. ! /* @(#)resources.h    1.4 olvwm version 4/17/91 */
  503.   
  504.   /* based on @(#) resources.h 25.14 90/05/31 Crucible */
  505.   
  506. --- 6,12 ----
  507.    *    Written for Sun Microsystems by Crucible, Santa Cruz, CA.
  508.    */
  509.   
  510. ! /* @(#)resources.h    1.5 olvwm version 6/22/91 */
  511.   
  512.   /* based on @(#) resources.h 25.14 90/05/31 Crucible */
  513.   
  514. ***************
  515. *** 114,120 ****
  516.   #define RM_AUTOROOTMENUY    62
  517.   #define RM_VIRTUALICONIC    63
  518.   #define RM_STICKYWINDOWS    64
  519. ! #define RM_ENTRYEND        65    /* number of entries in table */
  520.   
  521.   /* resource set functions */
  522.   static Bool    setBoolResource();
  523. --- 114,125 ----
  524.   #define RM_AUTOROOTMENUY    62
  525.   #define RM_VIRTUALICONIC    63
  526.   #define RM_STICKYWINDOWS    64
  527. ! #define RM_RELATIVEPOSITION    65
  528. ! #define RM_GRABVIRTUALKEYS    66
  529. ! #define RM_VIRTUALPIXMAPCOLOR    67
  530. ! #define RM_VIRTUALSHOWGRID    68
  531. ! #define RM_VIRTUALGRIDCOLOR    69
  532. ! #define RM_ENTRYEND        70    /* number of entries in table */
  533.   
  534.   /* resource set functions */
  535.   static Bool    setBoolResource();
  536. *** build/services.c    Sat Jun 22 20:09:35 1991
  537. --- src/services.c    Sat Jun 22 20:56:16 1991
  538. ***************
  539. *** 6,12 ****
  540.    *    Written for Sun Microsystems by Crucible, Santa Cruz, CA.
  541.    */
  542.   
  543. ! static char     sccsid[] = "@(#)services.c    1.3 olvwm version 4/17/91";
  544.   
  545.   /*
  546.    * Based on
  547. --- 6,12 ----
  548.    *    Written for Sun Microsystems by Crucible, Santa Cruz, CA.
  549.    */
  550.   
  551. ! static char     sccsid[] = "@(#)services.c    1.4 olvwm version 6/22/91";
  552.   
  553.   /*
  554.    * Based on
  555. ***************
  556. *** 518,526 ****
  557.          for (i = 0; i < argc; i++) {
  558.              print_quoted_word(SaveFile, argv[i]);
  559.              putc(' ', SaveFile);
  560. -            putc('&', SaveFile);
  561. -            putc('\n', SaveFile);
  562.          }
  563.          XFreeStringList(argv);
  564.       }
  565.       }
  566. --- 518,526 ----
  567.          for (i = 0; i < argc; i++) {
  568.              print_quoted_word(SaveFile, argv[i]);
  569.              putc(' ', SaveFile);
  570.          }
  571. +        putc('&', SaveFile);
  572. +        putc('\n', SaveFile);
  573.          XFreeStringList(argv);
  574.       }
  575.       }
  576. ***************
  577. *** 736,741 ****
  578. --- 736,743 ----
  579.       int        state;
  580.   
  581.   {
  582. +     if (cli->groupid == VDM)
  583. +     return NULL;
  584.       cli->sticky = state;
  585.       if (cli->sticky) {
  586.       cli->iconwin->fcore.menu = &IconFullMenuSticky;
  587. ***************
  588. *** 836,842 ****
  589.                   break;
  590.       
  591.       case FFA_STICKY:
  592. !         MakeSticky(cli, ~cli->sticky);
  593.           if (cli->groupmask == GROUP_LEADER)
  594.               GroupApply(cli->groupid, MakeSticky,
  595.                   cli->sticky, GROUP_DEPENDENT);
  596. --- 838,844 ----
  597.                   break;
  598.       
  599.       case FFA_STICKY:
  600. !         MakeSticky(cli, !cli->sticky);
  601.           if (cli->groupmask == GROUP_LEADER)
  602.               GroupApply(cli->groupid, MakeSticky,
  603.                   cli->sticky, GROUP_DEPENDENT);
  604. ***************
  605. *** 953,959 ****
  606.                   break;
  607.       
  608.       case FFA_STICKY:
  609. !         MakeSticky(cli, ~cli->sticky);
  610.           if (cli->groupmask == GROUP_LEADER)
  611.               GroupApply(cli->groupid, MakeSticky,
  612.                   cli->sticky, GROUP_DEPENDENT);
  613. --- 955,961 ----
  614.                   break;
  615.       
  616.       case FFA_STICKY:
  617. !         MakeSticky(cli, !cli->sticky);
  618.           if (cli->groupmask == GROUP_LEADER)
  619.               GroupApply(cli->groupid, MakeSticky,
  620.                   cli->sticky, GROUP_DEPENDENT);
  621. *** build/slots.c    Sat Jun 22 20:09:18 1991
  622. --- src/slots.c    Sat Jun 22 20:56:17 1991
  623. ***************
  624. *** 6,12 ****
  625.    *    Written for Sun Microsystems by Crucible, Santa Cruz, CA.
  626.    */
  627.   
  628. ! static char     sccsid[] = "@(#)slots.c    1.2 olvwm version 3/30/91";
  629.   
  630.   /* based on @(#) slots.c 1.5 90/05/15 Crucible */
  631.   
  632. --- 6,12 ----
  633.    *    Written for Sun Microsystems by Crucible, Santa Cruz, CA.
  634.    */
  635.   
  636. ! static char     sccsid[] = "@(#)slots.c    1.3 olvwm version 6/22/91";
  637.   
  638.   /* based on @(#) slots.c 1.5 90/05/15 Crucible */
  639.   
  640. ***************
  641. *** 45,54 ****
  642.   
  643.   #define PLUSINFINITY 0xfffffff    /* REMIND fix this for architecture-independence */
  644.   
  645. - #ifdef BRAP
  646. - extern int VirtualDesktopHeight, VirtualDesktopWidth, VirtualDesktopX, VirtualDesktopY;
  647. - #endif
  648.   /***************************************************************************
  649.   * Local functions
  650.   ***************************************************************************/
  651. --- 45,50 ----
  652. ***************
  653. *** 231,239 ****
  654.   /* setIconPos -- given a slot, position the icon frame window accordingly.
  655.    */
  656.   static void 
  657. ! setIconPos(win, slot)
  658.   WinIconFrame *win;
  659.   IconSlot *slot;
  660.   {
  661.       int x,y;
  662.   
  663. --- 227,236 ----
  664.   /* setIconPos -- given a slot, position the icon frame window accordingly.
  665.    */
  666.   static void 
  667. ! setIconPos(win, slot,adj_x, adj_y)
  668.   WinIconFrame *win;
  669.   IconSlot *slot;
  670. + int    adj_x, adj_y;
  671.   {
  672.       int x,y;
  673.   
  674. ***************
  675. *** 286,292 ****
  676.       }
  677.       }
  678.   
  679. !     (WinFunc(win,core.newposfunc))(win,x,y);
  680.   }
  681.   
  682.   /* incrPositionedSlots -- an icon has been explicitly positioned; create an
  683. --- 283,289 ----
  684.       }
  685.       }
  686.   
  687. !     (WinFunc(win,core.newposfunc))(win, x + adj_x, y + adj_y);
  688.   }
  689.   
  690.   /* incrPositionedSlots -- an icon has been explicitly positioned; create an
  691. ***************
  692. *** 416,432 ****
  693.   {
  694.       int nhoriz, nvert;    /* number of slots occupied, horizontally & vertically */
  695.       int nmajor, nminor;    /* number of slots occupied, in major & minor directions */
  696.       IconSlot *slot;
  697.   
  698.       iconList = ListCons(winicon, iconList);
  699.   
  700.       if (positioned)
  701.       {
  702. !     slot = incrPositionedSlots(winicon->core.x, winicon->core.y, 
  703.           winicon->core.width, winicon->core.height, snaptogrid);
  704.       winicon->iconslot = slot;
  705.       if (snaptogrid)
  706. !         setIconPos(winicon,slot);
  707.       else
  708.           (WinFunc(winicon,core.newposfunc))(winicon,winicon->core.x,winicon->core.y);
  709.       }
  710. --- 413,435 ----
  711.   {
  712.       int nhoriz, nvert;    /* number of slots occupied, horizontally & vertically */
  713.       int nmajor, nminor;    /* number of slots occupied, in major & minor directions */
  714. +     int    scr_x, scr_y;
  715.       IconSlot *slot;
  716. +     Display    *dpy = winicon->core.client->dpy;
  717.   
  718.       iconList = ListCons(winicon, iconList);
  719.   
  720.       if (positioned)
  721.       {
  722. !     scr_x = abs(winicon->core.x % DisplayWidth(dpy,DefaultScreen(dpy)));
  723. !     scr_y = abs(winicon->core.y % DisplayHeight(dpy,DefaultScreen(dpy)));
  724. !     slot = incrPositionedSlots(scr_x, scr_y,
  725.           winicon->core.width, winicon->core.height, snaptogrid);
  726.       winicon->iconslot = slot;
  727.       if (snaptogrid)
  728. !         setIconPos(winicon, slot,
  729. !         winicon->core.x - scr_x, winicon->core.y - scr_y);
  730.       else
  731.           (WinFunc(winicon,core.newposfunc))(winicon,winicon->core.x,winicon->core.y);
  732.       }
  733. ***************
  734. *** 437,443 ****
  735.       setMajorMinor(nvert, nhoriz, &nmajor, &nminor);
  736.       slot = incrDynamicSlots(nmajor, nminor);
  737.       winicon->iconslot = slot;
  738. !     setIconPos(winicon,slot);
  739.       }
  740.   
  741.       return slot;
  742. --- 440,446 ----
  743.       setMajorMinor(nvert, nhoriz, &nmajor, &nminor);
  744.       slot = incrDynamicSlots(nmajor, nminor);
  745.       winicon->iconslot = slot;
  746. !     setIconPos(winicon,slot,0,0);
  747.       }
  748.   
  749.       return slot;
  750. *** build/states.c    Sat Jun 22 20:09:33 1991
  751. --- src/states.c    Sat Jun 22 20:56:17 1991
  752. ***************
  753. *** 9,15 ****
  754.    *    (Normal, Iconic, Withdrawn)
  755.    */
  756.   
  757. ! static char     sccsid[] = "@(#)states.c    1.4 olvwm version 4/17/91";
  758.   
  759.   /*
  760.    * Based on
  761. --- 9,15 ----
  762.    *    (Normal, Iconic, Withdrawn)
  763.    */
  764.   
  765. ! static char     sccsid[] = "@(#)states.c    1.5 olvwm version 6/22/91";
  766.   
  767.   /*
  768.    * Based on
  769. ***************
  770. *** 135,141 ****
  771.   };
  772.   
  773.   typedef struct {
  774. !     char *class, *instance;
  775.   } minimalclosure;
  776.   
  777.   /***************************************************************************
  778. --- 135,141 ----
  779.   };
  780.   
  781.   typedef struct {
  782. !     char *class, *instance, *name;
  783.   } minimalclosure;
  784.   
  785.   /***************************************************************************
  786. ***************
  787. *** 162,168 ****
  788. --- 162,182 ----
  789.       return True;
  790.   }
  791.   
  792. + static Bool
  793. + matchInstClassName(str,mc)
  794. + char *str;
  795. + minimalclosure *mc;
  796. + {
  797. +     if ((mc->class != NULL) && (!strcmp(str,mc->class)))
  798. +     return True;
  799. +     if ((mc->instance != NULL) && (!strcmp(str,mc->instance)))
  800. +     return True;
  801. +     if ((mc->name != NULL) && (!strncmp(str,mc->name,strlen(str))))
  802. +     return True;
  803. +     return False;
  804. + }
  805.   
  806.   /*
  807.    * getOlWinDecors - given the window attributes and decoration add/delete
  808.    *    requests, determine what kind of window (according to the OpenLook
  809. ***************
  810. *** 530,536 ****
  811.        * we don't have a race condition in finding out.
  812.        */
  813.       
  814. !     if (!ourWinInfo && !IsVirtual(window))
  815.           XSelectInput(dpy, window, StructureNotifyMask);
  816.   
  817.           /* get all the info about the new pane */
  818. --- 544,550 ----
  819.        * we don't have a race condition in finding out.
  820.        */
  821.       
  822. !     if (!ourWinInfo && !IsVirtual(dpy, window))
  823.           XSelectInput(dpy, window, StructureNotifyMask);
  824.   
  825.           /* get all the info about the new pane */
  826. ***************
  827. *** 662,668 ****
  828.            */
  829.           calcPosition(dpy, screen, &paneAttr);
  830.       }
  831. !     else if (!fexisting && (normalHints->flags & USPosition)) {
  832.           paneAttr.x += VirtualDesktopX;
  833.           paneAttr.y += VirtualDesktopY;
  834.       }
  835. --- 676,683 ----
  836.            */
  837.           calcPosition(dpy, screen, &paneAttr);
  838.       }
  839. !     else if (!fexisting && (normalHints->flags & USPosition) &&
  840. !             !GRV.RelativePosition) {
  841.           paneAttr.x += VirtualDesktopX;
  842.           paneAttr.y += VirtualDesktopY;
  843.       }
  844. ***************
  845. *** 756,762 ****
  846.           /* figure out what focus mode this window intends */
  847.           if ((cli->wmHints) && (cli->wmHints->input))
  848.           {
  849. !                 if (cli->protocols & TAKE_FOCUS)
  850.                           cli->focusMode = LocallyActive;
  851.                   else
  852.                           cli->focusMode = Passive;
  853. --- 771,783 ----
  854.           /* figure out what focus mode this window intends */
  855.           if ((cli->wmHints) && (cli->wmHints->input))
  856.           {
  857. !         /*
  858. !          * Can't have the VDM locally active, since we'll end
  859. !          * up grabbing events away from ourself . . .
  860. !          */
  861. !         if (cli->groupid == VDM)
  862. !             cli->focusMode = GloballyActive;
  863. !                 else if (cli->protocols & TAKE_FOCUS)
  864.                           cli->focusMode = LocallyActive;
  865.                   else
  866.                           cli->focusMode = Passive;
  867. ***************
  868. *** 774,782 ****
  869.       else {
  870.           mc.class = cli->wmClass;
  871.           mc.instance = cli->wmInstance;
  872. !         if (ListApply(GRV.StickyList,matchInstClass,&mc) != NULL)
  873.               cli->sticky = TRUE;
  874.           else cli->sticky = FALSE;
  875.       }
  876.   
  877.       /* officially set up the frame */
  878. --- 795,807 ----
  879.       else {
  880.           mc.class = cli->wmClass;
  881.           mc.instance = cli->wmInstance;
  882. !         if (!XFetchName(dpy, window, &mc.name))
  883. !             mc.name = NULL;
  884. !         if (ListApply(GRV.StickyList,matchInstClassName,&mc) != NULL)
  885.               cli->sticky = TRUE;
  886.           else cli->sticky = FALSE;
  887. +         if (mc.name)
  888. +         XFree(mc.name);
  889.       }
  890.   
  891.       /* officially set up the frame */
  892. ***************
  893. *** 838,845 ****
  894.       if (cli->groupmask == GROUP_DEPENDENT)
  895.       {
  896.           Client *leader = GroupLeader(cli->groupid);
  897. !         if (leader != NULL)
  898.           initstate = leader->wmState;
  899.       }
  900.   
  901.       if (window == VDM)
  902. --- 863,874 ----
  903.       if (cli->groupmask == GROUP_DEPENDENT)
  904.       {
  905.           Client *leader = GroupLeader(cli->groupid);
  906. !         if (leader != NULL) {
  907.           initstate = leader->wmState;
  908. +         cli->sticky = leader->sticky;
  909. +         }
  910. +         else if (cli->groupid == NoFocusWin)
  911. +         cli->sticky = True;
  912.       }
  913.   
  914.       if (window == VDM)
  915. *** build/usermenu.c    Sat Jun 22 20:09:25 1991
  916. --- src/usermenu.c    Sat Jun 22 20:56:18 1991
  917. ***************
  918. *** 6,12 ****
  919.    *    Written for Sun Microsystems by Crucible, Santa Cruz, CA.
  920.    */
  921.   
  922. ! static char     sccsid[] = "@(#)usermenu.c    1.2 olvwm version 3/30/91";
  923.   
  924.   /*
  925.    * Based on
  926. --- 6,12 ----
  927.    *    Written for Sun Microsystems by Crucible, Santa Cruz, CA.
  928.    */
  929.   
  930. ! static char     sccsid[] = "@(#)usermenu.c    1.3 olvwm version 6/22/91";
  931.   
  932.   /*
  933.    * Based on
  934. ***************
  935. *** 184,190 ****
  936. --- 184,242 ----
  937.           };
  938.   Menu DefaultRootMenu = { "Workspace", RootButtons, 4, -1, True, (FuncPtr)MakeMenu};
  939.   
  940. + char *
  941. + expand_path(s)
  942. +     char    *s;
  943.   
  944. + {
  945. + char    *t, *p_s, *p_t;
  946. + static char *delim = "!$^&*(){}';:<>?/.,\"`~[]";
  947. + int    brace, len;
  948. + char    env[256], *env_p, *getenv();
  949. +     t = (char *) calloc(1, strlen(s) + 1);
  950. +     if (!t)
  951. +     return NULL;
  952. +     for (p_s = s, p_t = t; *p_s; ) {
  953. +     if (*p_s == '$') {
  954. +         if (p_s[1] == '{') {
  955. +         brace = True;
  956. +         p_s = p_s + 2;
  957. +         }
  958. +         else {
  959. +         brace = False;
  960. +         p_s++;
  961. +         }
  962. +         len = strcspn(p_s, delim);
  963. +         strncpy(env, p_s, len);
  964. +         env[len] = '\0';
  965. +         if ((env_p = getenv(env)) == NULL) {
  966. +         /* better punt, but there's are error here somewhere */
  967. +         if (brace) {
  968. +             bcopy(p_s - 2, p_t, len + 2);
  969. +             p_t += len + 2;
  970. +         }
  971. +         else {
  972. +             bcopy(p_s - 1, p_t, len + 1);
  973. +             p_t += len + 1;
  974. +         }
  975. +         p_s += len;
  976. +         }
  977. +         else {
  978. +         t = (char *)
  979. +             realloc(t, strlen(t) + strlen(p_s) + strlen(env_p) + 1);
  980. +         strcat(t, env_p);
  981. +         p_t += strlen(env_p);
  982. +         }
  983. +         p_s += len;
  984. +     }    /* } never match braces in vi */
  985. +     else *p_t++ = *p_s++;
  986. +     }
  987. +     *p_t = '\0';
  988. +     return t;
  989. + }
  990.   /*
  991.    * Global routines
  992.    */
  993. ***************
  994. *** 287,296 ****
  995. --- 339,350 ----
  996.       int         lineno = 1;    /* Needed for recursion */
  997.       int         rval;
  998.   
  999. +     file = expand_path(file);
  1000.       stream = fopen(file, "r");
  1001.       if (stream == NULL) {
  1002.           if (messages)
  1003.           fprintf(stderr, "olvwm: can't open menu file %s\n", file);
  1004. +         free(file);
  1005.           return(MENU_NOTFOUND);
  1006.       }
  1007.   
  1008. ***************
  1009. *** 301,306 ****
  1010. --- 355,361 ----
  1011.       else
  1012.           freeMenuData(menu);
  1013.   
  1014. +     free(file);
  1015.       return(rval);
  1016.   }
  1017.  
  1018. --
  1019. Dan Heller
  1020. O'Reilly && Associates       Z-Code Software    Comp-sources-x:
  1021. Senior Writer                President          comp-sources-x@uunet.uu.net
  1022. argv@ora.com                 argv@zipcode.com
  1023.